<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">

	$(document).ready(function(){
		$("#loginF").submit(function(event){
			$.ajax({
				type : "post",
				url : "${initParam.root}/member/login.do",
				data:$(this).serialize(),
				datatype:"json",
				success:function(data){
					
					if(data==false)
						{
							alert("로그인 실패!!");
						}
					else if(data==true)
						{
							alert("로그인 성공!!");
							window.opener.location.href="${initParam.root }/main.do";
							self.close();
						}
					
					
					
				}
			});
			event.preventDefault();
		});//submit
		
	});
</script>
</head>
<body>
<h3>로그인</h3>
<form id="loginF">
아이디 : <input type="text" name="id"><br>
패스워드 : <input type="password" name="password"><Br>
<input type="submit" value="로그인"><br>
</form>
</body>
</html>